import { createBrowserRouter } from "react-router-dom";
import App from "../App";
import Home from "../prese/Home/Index";
import List from "../prese/List/Index";
import { lazy } from "react";
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
} from "@ant-design/icons";
const Homeone = lazy(() => import("../prese/Homeone/Index"));
const Hometwo = lazy(() => import("../prese/Hometwo/Index"));
const Aa = lazy(() => import("../prese/aa/Index"));
const Bb = lazy(() => import("../prese/bb/Index"));
const Dd = lazy(() => import("../prese/dd/Index"));
export const erji = [
  {
    path: "/home/homeone",
    element: <Homeone></Homeone>,
    title: "系统",
    icon: <DesktopOutlined></DesktopOutlined>,
    children: [
      {
        path: "/home/homeone/aa",
        element: <Aa></Aa>,
        title: "用户管理",
        icon: <TeamOutlined></TeamOutlined>,
      },
      {
        path: "/home/homeone/bb",
        element: <Bb />,
        title: "岗位管理",
        icon: <PieChartOutlined></PieChartOutlined>,
      },
      {
        path: "/home/homeone/dd",
        element: <Dd />,
        title: "支付",
        icon: <PieChartOutlined></PieChartOutlined>,
      },
    ],
  },
  {
    path: "/home/hometwo",
    element: <Hometwo />,
    title: "后台",
    icon: <FileOutlined></FileOutlined>,
  },
];
const router = createBrowserRouter([
  {
    path: "/",
    element: <App></App>,
    children: [
      {
        index: true,
        element: <Home />,
      },
      {
        path: "/home",
        element: <Home />,
        children: erji,
      },
      {
        path: "/login",
        element: <List></List>,
      },
    ],
  },
]);

export default router;
